Option Strict On
Option Explicit On 

Public Class FDefault
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnApply As System.Windows.Forms.Button
    Friend WithEvents btnOk As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents UCommand1 As Avand.UCommand
    Friend WithEvents UDefault1 As Avand.UDefault
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FDefault))
        Me.btnApply = New System.Windows.Forms.Button
        Me.btnOk = New System.Windows.Forms.Button
        Me.btnCancel = New System.Windows.Forms.Button
        Me.UCommand1 = New Avand.UCommand
        Me.UDefault1 = New Avand.UDefault
        Me.SuspendLayout()
        '
        'btnApply
        '
        Me.btnApply.AccessibleDescription = resources.GetString("btnApply.AccessibleDescription")
        Me.btnApply.AccessibleName = resources.GetString("btnApply.AccessibleName")
        Me.btnApply.Anchor = CType(resources.GetObject("btnApply.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnApply.BackgroundImage = CType(resources.GetObject("btnApply.BackgroundImage"), System.Drawing.Image)
        Me.btnApply.Dock = CType(resources.GetObject("btnApply.Dock"), System.Windows.Forms.DockStyle)
        Me.btnApply.Enabled = CType(resources.GetObject("btnApply.Enabled"), Boolean)
        Me.btnApply.FlatStyle = CType(resources.GetObject("btnApply.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnApply.Font = CType(resources.GetObject("btnApply.Font"), System.Drawing.Font)
        Me.btnApply.Image = CType(resources.GetObject("btnApply.Image"), System.Drawing.Image)
        Me.btnApply.ImageAlign = CType(resources.GetObject("btnApply.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnApply.ImageIndex = CType(resources.GetObject("btnApply.ImageIndex"), Integer)
        Me.btnApply.ImeMode = CType(resources.GetObject("btnApply.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnApply.Location = CType(resources.GetObject("btnApply.Location"), System.Drawing.Point)
        Me.btnApply.Name = "btnApply"
        Me.btnApply.RightToLeft = CType(resources.GetObject("btnApply.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnApply.Size = CType(resources.GetObject("btnApply.Size"), System.Drawing.Size)
        Me.btnApply.TabIndex = CType(resources.GetObject("btnApply.TabIndex"), Integer)
        Me.btnApply.Text = resources.GetString("btnApply.Text")
        Me.btnApply.TextAlign = CType(resources.GetObject("btnApply.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnApply.Visible = CType(resources.GetObject("btnApply.Visible"), Boolean)
        '
        'btnOk
        '
        Me.btnOk.AccessibleDescription = resources.GetString("btnOk.AccessibleDescription")
        Me.btnOk.AccessibleName = resources.GetString("btnOk.AccessibleName")
        Me.btnOk.Anchor = CType(resources.GetObject("btnOk.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnOk.BackgroundImage = CType(resources.GetObject("btnOk.BackgroundImage"), System.Drawing.Image)
        Me.btnOk.Dock = CType(resources.GetObject("btnOk.Dock"), System.Windows.Forms.DockStyle)
        Me.btnOk.Enabled = CType(resources.GetObject("btnOk.Enabled"), Boolean)
        Me.btnOk.FlatStyle = CType(resources.GetObject("btnOk.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnOk.Font = CType(resources.GetObject("btnOk.Font"), System.Drawing.Font)
        Me.btnOk.Image = CType(resources.GetObject("btnOk.Image"), System.Drawing.Image)
        Me.btnOk.ImageAlign = CType(resources.GetObject("btnOk.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnOk.ImageIndex = CType(resources.GetObject("btnOk.ImageIndex"), Integer)
        Me.btnOk.ImeMode = CType(resources.GetObject("btnOk.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnOk.Location = CType(resources.GetObject("btnOk.Location"), System.Drawing.Point)
        Me.btnOk.Name = "btnOk"
        Me.btnOk.RightToLeft = CType(resources.GetObject("btnOk.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnOk.Size = CType(resources.GetObject("btnOk.Size"), System.Drawing.Size)
        Me.btnOk.TabIndex = CType(resources.GetObject("btnOk.TabIndex"), Integer)
        Me.btnOk.Text = resources.GetString("btnOk.Text")
        Me.btnOk.TextAlign = CType(resources.GetObject("btnOk.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnOk.Visible = CType(resources.GetObject("btnOk.Visible"), Boolean)
        '
        'btnCancel
        '
        Me.btnCancel.AccessibleDescription = resources.GetString("btnCancel.AccessibleDescription")
        Me.btnCancel.AccessibleName = resources.GetString("btnCancel.AccessibleName")
        Me.btnCancel.Anchor = CType(resources.GetObject("btnCancel.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnCancel.BackgroundImage = CType(resources.GetObject("btnCancel.BackgroundImage"), System.Drawing.Image)
        Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.btnCancel.Dock = CType(resources.GetObject("btnCancel.Dock"), System.Windows.Forms.DockStyle)
        Me.btnCancel.Enabled = CType(resources.GetObject("btnCancel.Enabled"), Boolean)
        Me.btnCancel.FlatStyle = CType(resources.GetObject("btnCancel.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnCancel.Font = CType(resources.GetObject("btnCancel.Font"), System.Drawing.Font)
        Me.btnCancel.Image = CType(resources.GetObject("btnCancel.Image"), System.Drawing.Image)
        Me.btnCancel.ImageAlign = CType(resources.GetObject("btnCancel.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnCancel.ImageIndex = CType(resources.GetObject("btnCancel.ImageIndex"), Integer)
        Me.btnCancel.ImeMode = CType(resources.GetObject("btnCancel.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnCancel.Location = CType(resources.GetObject("btnCancel.Location"), System.Drawing.Point)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.RightToLeft = CType(resources.GetObject("btnCancel.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnCancel.Size = CType(resources.GetObject("btnCancel.Size"), System.Drawing.Size)
        Me.btnCancel.TabIndex = CType(resources.GetObject("btnCancel.TabIndex"), Integer)
        Me.btnCancel.Text = resources.GetString("btnCancel.Text")
        Me.btnCancel.TextAlign = CType(resources.GetObject("btnCancel.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnCancel.Visible = CType(resources.GetObject("btnCancel.Visible"), Boolean)
        '
        'UCommand1
        '
        Me.UCommand1.AccessibleDescription = resources.GetString("UCommand1.AccessibleDescription")
        Me.UCommand1.AccessibleName = resources.GetString("UCommand1.AccessibleName")
        Me.UCommand1.Anchor = CType(resources.GetObject("UCommand1.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.UCommand1.AutoScroll = CType(resources.GetObject("UCommand1.AutoScroll"), Boolean)
        Me.UCommand1.AutoScrollMargin = CType(resources.GetObject("UCommand1.AutoScrollMargin"), System.Drawing.Size)
        Me.UCommand1.AutoScrollMinSize = CType(resources.GetObject("UCommand1.AutoScrollMinSize"), System.Drawing.Size)
        Me.UCommand1.BackgroundImage = CType(resources.GetObject("UCommand1.BackgroundImage"), System.Drawing.Image)
        Me.UCommand1.Dock = CType(resources.GetObject("UCommand1.Dock"), System.Windows.Forms.DockStyle)
        Me.UCommand1.Enabled = CType(resources.GetObject("UCommand1.Enabled"), Boolean)
        Me.UCommand1.Font = CType(resources.GetObject("UCommand1.Font"), System.Drawing.Font)
        Me.UCommand1.ImeMode = CType(resources.GetObject("UCommand1.ImeMode"), System.Windows.Forms.ImeMode)
        Me.UCommand1.Location = CType(resources.GetObject("UCommand1.Location"), System.Drawing.Point)
        Me.UCommand1.Name = "UCommand1"
        Me.UCommand1.RightToLeft = CType(resources.GetObject("UCommand1.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.UCommand1.Size = CType(resources.GetObject("UCommand1.Size"), System.Drawing.Size)
        Me.UCommand1.TabIndex = CType(resources.GetObject("UCommand1.TabIndex"), Integer)
        Me.UCommand1.Visible = CType(resources.GetObject("UCommand1.Visible"), Boolean)
        '
        'UDefault1
        '
        Me.UDefault1.AccessibleDescription = resources.GetString("UDefault1.AccessibleDescription")
        Me.UDefault1.AccessibleName = resources.GetString("UDefault1.AccessibleName")
        Me.UDefault1.Anchor = CType(resources.GetObject("UDefault1.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.UDefault1.AutoScroll = CType(resources.GetObject("UDefault1.AutoScroll"), Boolean)
        Me.UDefault1.AutoScrollMargin = CType(resources.GetObject("UDefault1.AutoScrollMargin"), System.Drawing.Size)
        Me.UDefault1.AutoScrollMinSize = CType(resources.GetObject("UDefault1.AutoScrollMinSize"), System.Drawing.Size)
        Me.UDefault1.BackgroundImage = CType(resources.GetObject("UDefault1.BackgroundImage"), System.Drawing.Image)
        Me.UDefault1.Dock = CType(resources.GetObject("UDefault1.Dock"), System.Windows.Forms.DockStyle)
        Me.UDefault1.Enabled = CType(resources.GetObject("UDefault1.Enabled"), Boolean)
        Me.UDefault1.Font = CType(resources.GetObject("UDefault1.Font"), System.Drawing.Font)
        Me.UDefault1.ImeMode = CType(resources.GetObject("UDefault1.ImeMode"), System.Windows.Forms.ImeMode)
        Me.UDefault1.Location = CType(resources.GetObject("UDefault1.Location"), System.Drawing.Point)
        Me.UDefault1.Name = "UDefault1"
        Me.UDefault1.RightToLeft = CType(resources.GetObject("UDefault1.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.UDefault1.Size = CType(resources.GetObject("UDefault1.Size"), System.Drawing.Size)
        Me.UDefault1.TabIndex = CType(resources.GetObject("UDefault1.TabIndex"), Integer)
        Me.UDefault1.Visible = CType(resources.GetObject("UDefault1.Visible"), Boolean)
        '
        'FDefault
        '
        Me.AcceptButton = Me.btnOk
        Me.AccessibleDescription = resources.GetString("$this.AccessibleDescription")
        Me.AccessibleName = resources.GetString("$this.AccessibleName")
        Me.AutoScaleBaseSize = CType(resources.GetObject("$this.AutoScaleBaseSize"), System.Drawing.Size)
        Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean)
        Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size)
        Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.CancelButton = Me.btnCancel
        Me.ClientSize = CType(resources.GetObject("$this.ClientSize"), System.Drawing.Size)
        Me.Controls.Add(Me.UDefault1)
        Me.Controls.Add(Me.UCommand1)
        Me.Controls.Add(Me.btnApply)
        Me.Controls.Add(Me.btnOk)
        Me.Controls.Add(Me.btnCancel)
        Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean)
        Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode)
        Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point)
        Me.MaximizeBox = False
        Me.MaximumSize = CType(resources.GetObject("$this.MaximumSize"), System.Drawing.Size)
        Me.MinimizeBox = False
        Me.MinimumSize = CType(resources.GetObject("$this.MinimumSize"), System.Drawing.Size)
        Me.Name = "FDefault"
        Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.ShowInTaskbar = False
        Me.StartPosition = CType(resources.GetObject("$this.StartPosition"), System.Windows.Forms.FormStartPosition)
        Me.Text = resources.GetString("$this.Text")
        Me.ResumeLayout(False)

    End Sub

#End Region

    'Private mChanged As Boolean
    'Private mDefault As Model10.Default
    'Private mTable As Model10.Table

    'Public Event ValueChenged As EventHandler

    'Private Sub FDefault_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '    AddHandler UCommand1.ValueChanged, AddressOf OnValueChanged
    '    AddHandler UDefault1.ValueChanged, AddressOf OnValueChanged
    'End Sub
    'Private Sub btnApply_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnApply.Click
    '    Application.DoEvents()
    '    Cursor.Current = Cursors.WaitCursor
    '    '----------------------------------
    '    Try
    '        Dim def As New Model10.Default
    '        UCommand1.Write(def) : UDefault1.Write(def)
    '        If mDefault Is Nothing Then
    '            If Not mTable Is Nothing Then mTable.Defaults.Add(def)
    '            mDefault = def
    '        Else
    '            UCommand1.Write(mDefault) : UDefault1.Write(mDefault)
    '        End If
    '        def = Nothing

    '        mChanged = True
    '        btnApply.Enabled = False
    '        RaiseEvent ValueChenged(Me, New EventArgs)
    '    Catch ex As Exception
    '        MsgBox(ex.Message)
    '    End Try
    '    '----------------------------------
    '    Cursor.Current = Cursors.Default
    'End Sub
    'Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
    '    btnApply.PerformClick()
    '    If Not btnApply.Enabled Then DialogResult = DialogResult.OK
    'End Sub

    'Protected Sub OnValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    '    btnApply.Enabled = True
    '    RaiseEvent ValueChenged(Me, New EventArgs)
    'End Sub

    'Public Property Changed() As Boolean
    '    Get
    '        Return mChanged
    '    End Get
    '    Set(ByVal Value As Boolean)
    '        mChanged = Value
    '    End Set
    'End Property
    'Public Property [Default]() As Model10.Default
    '    Get
    '        Return mDefault
    '    End Get
    '    Set(ByVal Value As Model10.Default)
    '        mDefault = Value
    '    End Set
    'End Property
    'Public Property Table() As Model10.Table
    '    Get
    '        Return mTable
    '    End Get
    '    Set(ByVal Value As Model10.Table)
    '        mTable = Value
    '    End Set
    'End Property

    'Public Sub Fill()
    '    UCommand1.Prepare(mTable) : UDefault1.Prepare(mTable)
    '    If mDefault Is Nothing Then
    '        Dim prt As New Model10.Default
    '        UCommand1.Read(prt) : UDefault1.Read(prt)
    '        prt = Nothing

    '        UDefault1.txtName.Text = mTable.GetNewDefaultName(Global.GetSystemResource("Element.Default"))

    '        btnApply.Enabled = True
    '    Else
    '        UCommand1.Read(mDefault) : UDefault1.Read(mDefault)

    '        btnApply.Enabled = False
    '    End If
    '    mChanged = False
    'End Sub
    'Public Sub New(ByVal table As Model10.Table, ByVal [default] As Model10.[Default])
    '    MyBase.New()
    '    InitializeComponent()

    '    mDefault = [default]
    '    mTable = table
    '    Fill()
    'End Sub
End Class
